{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

<div id="apps">
  <table class="table table-bordered avg-table">
    <tbody>
    <tr>
      <td></td>
      <td>{{t apps.avgTable.jobs}}</td>
      <td>{{t apps.avgTable.input}}</td>
      <td>{{t apps.avgTable.output}}</td>
      <td>{{t apps.avgTable.duration}}</td>
      <td>{{t apps.avgTable.oldest}}</td>
      <td>{{t apps.avgTable.mostRecent}}</td>
    </tr>
    <tr class="avg-info">
      <td>{{t apps.avgTable.avg}}</td>
      <td>{{summary.jobs.avg}}</td>
      <td>{{summary.input.avg}}</td>
      <td>{{summary.output.avg}}</td>
      <td>{{summary.duration.avg}}</td>
      <td>{{summary.times.oldest}}</td>
      <td>{{summary.times.youngest}}</td>

    </tr>
    <tr class="compare-info">
      <td>{{t apps.avgTable.min}} / {{t apps.avgTable.max}}</td>
      <td>{{summary.jobs.min}} / {{summary.jobs.max}}</td>
      <td>{{summary.input.min}} / {{summary.input.max}}</td>
      <td>{{summary.output.min}} / {{summary.output.max}}</td>
      <td>{{summary.duration.min}} / {{summary.duration.max}}</td>
      <td></td>
      <td></td>
    </tr>
    </tbody>
  </table>

  <div class="filter_info">

    <div class="span4" id="filter_buttons">{{t common.show}}:
      <a class="all" {{action "clickViewType" target="view"}} data-view-type="all">{{t tableView.filters.all}}
        ({{controller.paginationObject.iTotalRecords}})</a> &#124;
      <a class="filtered" {{action "clickViewType" target="view"}} data-view-type="filtered">{{t tableView.filters.filtered}}
        ({{controller.filterObject.filteredDisplayRecords}})</a>
    </div>
    <div class="span2 clear_filter">
        <a {{action "clearFilters" target="controller"}}>{{t tableView.filters.clearFilters}}</a>
    </div>
    <div class="search-bar">
        {{view view.appSearchThrough valueBinding="controller.filterObject.sSearch"}}
    </div>
  </div>

  <table class="table table-striped runsList">
    <thead>
    {{#view view.wrapSorting}}
      {{#each controller.columnsName}}
        {{#view view.parentView.sortingColumns contentBinding="this"}}
          {{name}}
        {{/view}}
      {{/each}}
    {{/view}}
    <tr>
      <th>{{view view.appIdFilterView}}</th>
      <th>{{view view.nameFilterView}}</th>
      <th>{{view view.typeFilterView}}</th>
      <th>{{view view.userFilterView}}</th>
      <th>{{view view.jobsFilterView}}</th>
      <th>{{view view.inputFilterView}}</th>
      <th>{{view view.outputFilterView}}</th>
      <th>{{view view.durationFilterView}}</th>
      <th>{{view view.runDateFilterView}}</th>
    </tr>
    </thead>
    <tbody>
       {{#if  view.emptyData}}
         <tr>
           <td class="no-data" {{bindAttr colspan="controller.columnsName.content.length"}}>{{t apps.filters.nothingToShow}}</td>
         </tr>
       {{else}}
         {{#each run in content}}
           {{view view.containerRow runBinding="run" currentViewBinding="view.appTableRow"}}
         {{/each}}
       {{/if}}
    </tbody>
  </table>

  <div class="page-bar">
      <div class="items-on-page">
          <label>{{t common.show}}: {{view view.runPerPageSelectView viewName="runPerPageSelectView" selectionBinding="controller.filterObject.iDisplayLength"}}</label>
      </div>
      <div class="info">{{view.paginationInfo}}</div>
      <div class="paging_two_button">
          {{view view.paginationLeft}}
          {{view view.paginationRight}}
      </div>
  </div>
</div>
